﻿@page "/"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits DiariesPageComponentBase

<MyAppBar>
    <MyTabs @bind-Value="tab"
            Items="tabListItems">
    </MyTabs>

    <MSpacer></MSpacer>

    <MultiSearch OnSearch="Search"></MultiSearch>
</MyAppBar>

<SwiperTabItems @ref="swiperTabItems"
                @bind-Value="tab">
    <SwiperTabItem>
        <MContainer Class="my-container"
                    Fluid="true">
            <IndexHead ShowDate="showDate"
                       ShowWelcomeText="showWelcomeText">
            </IndexHead>
            <DiaryCardList @bind-Value="Diaries"
                           @bind-Tags="Tags">
            </DiaryCardList>
        </MContainer>

    </SwiperTabItem>
    <SwiperTabItem>
        <MContainer Class="my-container"
                    Fluid="true">
            <TagCardList @bind-Value="Tags"
                         Diaries="Diaries">
            </TagCardList>
        </MContainer>
    </SwiperTabItem>
</SwiperTabItems>

<div class="right-bottom-float-area">
    <BackTopButton Class="mb-2"
                   Selector="@SwiperActiveItemSelector">
    </BackTopButton>
    <MWindow Value="tab" Style="overflow:unset;">
        <MWindowItem Transition="">
            <MyFloatButton Icon="mdi-pencil"
                           OnClick="@(()=>To("write"))">
            </MyFloatButton>
        </MWindowItem>
        <MWindowItem Transition="">
            <MyFloatButton Icon="mdi-plus"
                           OnClick="()=>showAddTag=true">
            </MyFloatButton>
        </MWindowItem>
    </MWindow>
</div>

<InputDialog @bind-Visible="showAddTag"
             Title="@(I18n.T("Tag.Add"))"
             Placeholder="@(I18n.T("Tag.Placeholder"))"
             OnOK="SaveAddTag">
</InputDialog>